<template>
    <a-card :bordered="false">
        <div class="table-operator">
            <a-button shape="round" size="small" type="primary" icon="plus" @click="handleEdit({},'pageEdit','新增')">添加</a-button>
        </div>

        <LTable
            ref="pageList"
            size="middle"
            rowKey="keyId"
            :formAttributes="formAttributes"
            :columns="columns"
            axiosUrl="/SysPageController/page"
            :showPagination="true"
            :showQueryForm="true"
            :initOrder="[{field:'createTime',val:'desc'}]"
        >
        
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record,'pageEdit',record.pageName)">编辑</a>
          <a-divider type="vertical" />
          <a @click="pageDel(record.keyId)">删除</a>
          
    
        </span>
        
    </LTable>
    <pageEdit ref="pageEdit" @close="refresh('pageList')" @ok="refresh('pageList')"></pageEdit> 
    </a-card>
</template>

<script>
import LTable from '@/components/lt/LTable'
import { Modal } from 'ant-design-vue'
import pageEdit from './pageEdit'
import {SysMixin} from '@/mixins/SysMixin'


export default {
    name:'roleList',
    components:{
       LTable,pageEdit
    },
    mixins:[SysMixin],
    data(){
        return{
            formAttributes:[
                {field:'systemName',label:'系统名称',component:'input',condition:'like'},
            ],
         
            columns:[
               
                {
                    title: '系统编号',
                    dataIndex: 'systemNo'
                },
                {
                    title: '页面编号',
                    dataIndex: 'keyId'
                    
                },
                {
                    title: '页面名称',
                    dataIndex: 'pageName'
                },
                
                {
                    title:'创建时间',
                    dataIndex:'createTime'
                },
                {
                    title: '操作',
                    dataIndex: 'action',
                    width: '120px',
                    scopedSlots: { customRender: 'action' }
                }
            ],
            
        }
    },
    created(){
       
    },
    methods:{
        pageDel(keyId){
            Modal.confirm({
                title: "系统提醒",
                content: "确定删除？",
                onOk: () => {
                    this.handleDelete({keyId:keyId},'/SysPageController/del','pageList')
                },
                onCancel () {}
            })
            
        },
        
    }
}
</script>